﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% Option Explicit %>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
<META NAME="copyright" CONTENT="Copyright 2009-2010 - Martechina Co.Ltd" />
<META NAME="Author" CONTENT="劢格机械(中国)  Www.Martechina.Com" />
<META NAME="Keywords" CONTENT="" />
<META NAME="Description" CONTENT="" />
<TITLE>网站信息设置</TITLE>
<link href="css.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../inc/Admin.js"></script>
</HEAD>
<!--#include file="../inc/Const.asp" -->
<!--#include file="../inc/ConnSiteData.asp" -->
<!--#include file="CheckAdmin.asp"-->
<%
'cookie 验证
'if Instr(request.cookies("Martech_com")("AdminPurview"),"|1,")=0 then 
'  response.write ("<font color='red')>你不具有该管理模块的操作权限，请返回！</font>")
'  response.end
'end if

'session 验证
if Instr(session("AdminPurview"),"|1,")=0 then 
  response.write ("<font color='red')>你不具有该管理模块的操作权限，请返回！</font>")
  response.end
end if
'========判断是否具有管理权限
%>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
select case request.QueryString("Action")
  case "Save"
    SaveSiteInfo
  case else
    ViewSiteInfo
end select
%>
<table border="0" cellspacing="1" cellpadding="0" height="0" align="center" width="100%" >
  <tr>
  <td>

<table border="0" cellspacing="1" cellpadding="3" bgcolor="#FFFFFF" align="center" width="100%">
  <form name="editForm" method="post" action="SetSite.asp?Action=Save" >
  <tr>
 <td height="27" colspan="4" align="center" class="classtop"><strong>参数设定</strong></td>
</tr>
      <tr class=classtd>
        <td   height="20" align="right">网站标题：(中文)</td>
        <td  ><input name="SiteTitle" type="text" class="textfield" id="SiteTitle" style="WIDTH: 400;" value="<%=SiteTitle%>" >&nbsp;*</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right">网站标题：(英文)</td>
        <td  ><input name="eSiteTitle" type="text" class="textfield" id="eSiteTitle" style="WIDTH: 400;" value="<%=eSiteTitle%>" >&nbsp;*</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right">网　　址：</td>
        <td  ><input name="SiteUrl" type="text" class="textfield" id="SiteUrl" style="WIDTH: 400;" value="<%=SiteUrl%>">&nbsp;*</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right">公司名称：(中文)</td>
        <td  ><input name="ComName" type="text" class="textfield" id="ComName" style="WIDTH: 400;" value="<%=ComName%>" >&nbsp;*</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right">公司名称：(英文)</td>
        <td  ><input name="eComName" type="text" class="textfield" id="eComName" style="WIDTH: 400;" value="<%=eComName%>" >&nbsp;*</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right">地　　址：(中文)</td>
        <td  ><input name="Address" type="text" class="textfield" id="Address" style="WIDTH: 400;" value="<%=Address%>" >&nbsp;*</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right">地　　址：(英文)</td>
        <td  ><input name="eAddress" type="text" class="textfield" id="eAddress" style="WIDTH: 400;" value="<%=eAddress%>" >&nbsp;*</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right">邮　　编：</td>
        <td  ><input name="ZipCode" type="text" class="textfield" id="ZipCode" style="WIDTH: 200;" value="<%=ZipCode%>" maxlength="20">&nbsp;*</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right">电　　话：</td>
        <td  ><input name="Telephone" type="text" class="textfield" id="Telephone" style="WIDTH: 200;" value="<%=Telephone%>">&nbsp;*</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right">传　　真：</td>
        <td  ><input name="Fax" type="text" class="textfield" id="Fax" style="WIDTH: 200;" value="<%=Fax%>" >&nbsp;*</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right">电子邮箱：</td>
        <td  ><input name="Email" type="text" class="textfield" id="Email" style="WIDTH: 200;" value="<%=Email%>">&nbsp;*&nbsp;</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right" valign="top">关 键 字：(中文)</td>
        <td  ><textarea name="Keywords" rows="6"  class="textfield" id="Keywords" style="WIDTH: 400;"><%=Keywords%></textarea>&nbsp;关键字设置有利于网站的搜索</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right" valign="top">关 键 字：(英文)</td>
        <td  ><textarea name="eKeywords" rows="6"  class="textfield" id="eKeywords" style="WIDTH: 400;"><%=eKeywords%></textarea>&nbsp;关键字设置有利于网站的搜索</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right" valign="top">网站描述：(中文)</td>
        <td  ><textarea name="Descriptions" rows="6" class="textfield" id="Descriptions" style="WIDTH: 400;"><%=Descriptions%></textarea>&nbsp;网站描述设置有利于网站的搜索</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right" valign="top">网站描述：(英文)</td>
        <td  ><textarea name="eDescriptions" rows="6" class="textfield" id="eDescriptions" style="WIDTH: 400;"><%=eDescriptions%></textarea>&nbsp;网站描述设置有利于网站的搜索</td>
      </tr>
      <tr class=classtd>
        <td   height="20" align="right">ICP&nbsp;备案：</td>
        <td  ><input name="IcpNumber" type="text" class="textfield" id="IcpNumber" style="WIDTH: 200;" value="<%=IcpNumber%>"></td>
      </tr>

      <tr class=classtd>
        <td   height="30" align="right">&nbsp;</td>
        <td   valign="bottom"><input name="submitSaveEdit" type="submit" class="button"  id="submitSaveEdit" value="保存" style="WIDTH: 60;" ></td>
      </tr>

  </form>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
function SaveSiteInfo()
  if len(trim(request.Form("SiteTitle")))<3 then
    response.write ("<script language=javascript> alert('网站中文标题必填且不能少于3个字符！');history.back(-1);</script>")
    response.end
  end if
  if len(trim(request.Form("eSiteTitle")))<3 then
    response.write ("<script language=javascript> alert('网站英文标题必填且不能少于3个字符！');history.back(-1);</script>")
    response.end
  end if
   if len(trim(request.Form("SiteUrl")))<10 then
    response.write ("<script language=javascript> alert('网站网址不能为空，且不少于10个字符！');history.back(-1);</script>")
    response.end
  end if 
  if left(trim(request.Form("SiteUrl")),7)<>"http://" then
    response.write ("<script language=javascript> alert('网站网址请加上""http://""！');history.back(-1);</script>")
    response.end
  end if
  if len(trim(request.Form("ComName")))<3 then
    response.write ("<script language=javascript> alert('公司中文名称必填且不能少于3个字符！');history.back(-1);</script>")
    response.end
  end if
  if len(trim(request.Form("eComName")))<3 then
    response.write ("<script language=javascript> alert('公司英文名称必填且不能少于3个字符！');history.back(-1);</script>")
    response.end
  end if 
  if len(trim(request.Form("Address")))<3 then
    response.write ("<script language=javascript> alert('公司中文地址必填且不能少于3个字符！');history.back(-1);</script>")
    response.end
  end if
  if len(trim(request.Form("eAddress")))<3 then
    response.write ("<script language=javascript> alert('公司英文地址必填且不能少于3个字符！');history.back(-1);</script>")
    response.end
  end if
  if len(trim(request.Form("ZipCode")))<6 then
    response.write ("<script language=javascript> alert('邮政编码必填且不能少于6个字符！');history.back(-1);</script>")
    response.end
  end if
  if len(trim(request.Form("Telephone")))<11 then
    response.write ("<script language=javascript> alert('电话号码必填且不能少于11个字符！');history.back(-1);</script>")
    response.end
  end if
  if len(trim(request.Form("Fax")))<11 then
    response.write ("<script language=javascript> alert('传真号码必填且不能少于11个字符！');history.back(-1);</script>")
    response.end
  end if
  if len(trim(request.Form("Email")))<6 then
    response.write ("<script language=javascript> alert('电子邮箱必填具不能少于6个字符！');history.back(-1);</script>")
    response.end
  end if
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select top 1 * from Martech_Site"
  rs.open sql,conn,1,3
  rs("SiteTitle")=trim(Request.Form("SiteTitle"))
  rs("eSiteTitle")=trim(Request.Form("eSiteTitle"))
  rs("SiteUrl")=trim(Request.Form("SiteUrl"))
  rs("ComName")=trim(Request.Form("ComName"))
  rs("eComName")=trim(Request.Form("eComName"))
  rs("Address")=trim(Request.Form("Address"))
  rs("eAddress")=trim(Request.Form("eAddress"))
  rs("ZipCode")=trim(Request.Form("ZipCode"))
  rs("Telephone")=trim(Request.Form("Telephone"))
  rs("Fax")=trim(Request.Form("Fax"))
  rs("Email")=trim(Request.Form("Email"))
  rs("Keywords")=trim(Request.Form("Keywords"))
  rs("eKeywords")=trim(Request.Form("eKeywords"))
  rs("Descriptions")=trim(Request.Form("Descriptions"))
  rs("eDescriptions")=trim(Request.Form("eDescriptions"))
  rs("IcpNumber")=trim(Request.Form("IcpNumber"))
  rs.update
  rs.close
  set rs=nothing 
  response.write "<script language=javascript> alert('成功编辑网站信息！');changeAdminFlag('网站信息设置');location.replace('SetSite.asp');</script>"
end function

function ViewSiteInfo()
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select top 1 * from Martech_Site"
  rs.open sql,conn,1,1
  if rs.bof and rs.eof then
    response.write "读取数据库记录出错！"
    response.end
  else
    SiteTitle=rs("SiteTitle")
    eSiteTitle=rs("eSiteTitle")
    SiteUrl=rs("SiteUrl")
    ComName=rs("ComName")
    eComName=rs("eComName")
    Address=rs("Address")
    eAddress=rs("eAddress")
    ZipCode=rs("ZipCode")
    Telephone=rs("Telephone")
    Fax=rs("Fax")
    Email=rs("Email")
    Keywords=rs("Keywords")
    eKeywords=rs("eKeywords")
    Descriptions=rs("Descriptions")
    eDescriptions=rs("eDescriptions")
    IcpNumber=rs("IcpNumber")
    rs.close
    set rs=nothing 
  end if
end function
%>
